package com.myhome.money.demo.nacos.dubbo.service;


import com.alibaba.nacos.api.annotation.NacosProperties;
import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.alibaba.nacos.spring.context.annotation.config.EnableNacosConfig;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import org.springframework.context.annotation.Configuration;

/**
 * @author 许路路
 */
@Configuration
@EnableNacosConfig(globalProperties = @NacosProperties(serverAddr = "127.0.0.1:8848"))
@NacosPropertySource(dataId = "example", autoRefreshed = true)
public class NacosConfigTestBean {

    @NacosValue(value = "${springConfig:123456}", autoRefreshed = true)
    private String springConfig;

    public String demo() {
        return "value:" + springConfig;
    }
}
